package com.bee.shepherd.web;


import com.qunar.insurance.service.center.api.interceptor.LoginV2Intercepter;
import com.qunar.insurance.service.center.api.interceptor.StaffCookieV2Resolver;
import com.qunar.insurance.service.center.api.service.IAuthenticateService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;
import java.util.List;

/**
 * 所有有关WebMVC请通过这种方式;禁止使用@EnableWebMvc
**/
@Configuration
public class AppMvcConfigurer implements WebMvcConfigurer {

    //注入dubbo  bean
//    @Resource
    private IAuthenticateService authenticateService;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //service后台的指定拦截器类
//        LoginV2Intercepter loginV2Intercepter = new LoginV2Intercepter();
//        loginV2Intercepter.setAuthenticateService(authenticateService);
//        loginV2Intercepter.setHomePage(domain);
//        InterceptorRegistration interceptorRegistration = registry.addInterceptor(loginV2Intercepter);
//        interceptorRegistration.addPathPatterns("/admin/**").excludePathPatterns("*.css","*.js");

        //其他todo
    }

    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers){

//        resolvers.add(new StaffCookieV2Resolver());
    }


}
